projects
/
gpsbabel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c9c7313
)
Possible unterminated string in humminbird (#794)
author
GPSBabel
<12013583+GPSBabelDeveloper@users.noreply.github.com>
Thu, 16 Dec 2021 04:48:03 +0000
(23:48 -0500)
committer
GitHub
<noreply@github.com>
Thu, 16 Dec 2021 04:48:03 +0000
(23:48 -0500)
Leave space for null terminator when copying string into fixed-size buffer.
humminbird.cc
patch
|
blob
|
history
diff --git
a/humminbird.cc
b/humminbird.cc
index 40765ec489f390877af6c75e108e321a952170f6..ac628b9a30ed214b0705a2fecb4c631536300c9a 100644
(file)
--- a/
humminbird.cc
+++ b/
humminbird.cc
@@
-875,7
+875,7
@@
humminbird_rte_tail(const route_head* rte)
be_write32(&humrte->time, humrte->time);
QString name = mkshort(rtename_sh, rte->rte_name);
- strncpy(humrte->name, CSTR(name), sizeof(humrte->name));
+ strncpy(humrte->name, CSTR(name), sizeof(humrte->name)
-1
);
gbfputuint32(RTE_MAGIC, fout_);
gbfwrite(humrte, sizeof(*humrte), 1, fout_);